package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.mapper.TeacherMapper;
import com.example.demo.model.entity.TeacherEntity;
import com.example.demo.model.param.TeacherParam;
import com.example.demo.service.TeacherService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper,TeacherEntity> implements TeacherService {


    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public PageInfo selectTeacherList(TeacherParam teacherParam) {
        PageHelper.startPage(teacherParam.getPage(),teacherParam.getLimit());
        List list = teacherMapper.selectTeachersList(teacherParam);
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
}
